1. Field of the Invention
This invention relates to, for example, an electronic control apparatus into which a microprocessor used for fuel supply control of an engine for automobile is built, and particularly to a vehicle-mounted electronic control apparatus improved so as to standardize the apparatus in relation to control of various vehicles while miniaturizing the apparatus by improving handling of multiple input/output signals.
2. Description of the Related Art
FIG. 7 shows a typical block circuit diagram in a conventional electronic control apparatus of this kind, and an ECU (engine control unit) 1 formed of one printed board mainly comprises a large LSI (integrated circuit parts) 2, and the LSI 2 is formed by connecting a CPU (microprocessor) 3, nonvolatile flash memory 4, RAM 5, a data selector 6 for input, an A/D converter 7, output latch memory 8, etc. through a data bus 30.
The ECU 1 operates by receiving supply of a control power from a power unit 9 to which a power is supplied from a vehicle-mounted battery 10 through a power line 11 and a power switch 12, and execution programs for the above described or control constants for engine control are previously stored in the nonvolatile flash memory 4.
On the other hand, multiple on-off input signals from various sensor switches 13 are supplied from a bleeder resistor 14 acting as a pull-up or pull-down resistor to a comparator 19 through a series resistor 15 and a parallel capacitor 16 constructing a noise filter. An input resistor 17 and a positive feedback resistor 18 are connected to the comparator 19 and when a voltage applied to both ends of the parallel capacitor 16 exceeds a reference voltage applied to a negative side terminal of the comparator 19, a signal of logic xe2x80x9cHxe2x80x9d is supplied to the data selector 6.
However, when the voltage applied to both ends of the parallel capacitor 16 drops, input by the positive feedback resistor 18 is added, so that the voltage drops to a voltage lower than the reference voltage, and whereby an output of the comparator 19 returns to logic xe2x80x9cLxe2x80x9d.
In this manner, the comparator 19 acts as a comparator for level decision including a hysteresis function, and it is constructed so that outputs of multiple comparators 19 are stored in the RAM 5 through the data selector 6 and the data bus 30.
Incidentally, the data selector 6 handles, for example, an input of 16 bits and produces an output to the data bus 30 when a chip select signal is received from the CPU 3. The number of inputs extends to several tens and a plurality of the data selectors are used.
Also, multiple analog signals from various analog sensors 20 are supplied to the A/D converter 7 through a series resistor 21 and a parallel capacitor 22 constructing a noise filter, and digital outputs of the A/D converters receiving a chip select signal from the CPU 3 are stored in the RAM 5 through the data bus 30.
A control output of the CPU 3 is stored in the latch memory 8 through the data bus 30 and drives an external load 26 through an output transistor 23, and a plurality of the latch memory are used to cope with a number of control outputs and it is constructed so that the control output is stored to the latch memory chip-selected by the CPU 3.
Incidentally, numeral 24 denotes a base resistor for driving of the transistor 23, and numeral 25 denotes a ballast resistor connected between a base and an emitter of the transistor 23, and numeral 27 denotes a power relay for feed to the external load 26.
In the conventional apparatus constructed in this manner, there were problems in that a scale of the LSI 2 becomes large since the CPU 3 handles extremely multiple inputs/outputs and capacitors with various capacities need to be used in the parallel capacitors 16, 22 acting as the noise filters in order to ensure an intended filter constant and thus standardization is difficult and large capacitors need to be used in order to ensure a large filter constant, and thus the ECU 1 becomes large-scale.
As means for reducing input/output terminals of the LSI 2 to do miniaturization, as shown in xe2x80x9cinput/output processing ICxe2x80x9d disclosed in JP-A-7-13912, a method of communicating multiple input/output signals in a time sharing manner using serial communication blocks is proposed.
However, in this method, there are problems in that noise filters with various capacities are necessary and it is not suitable for standardization of an apparatus and also a capacitor with a large capacity is required in order to ensure a sufficient filter constant and it is also not suitable for miniaturization of the apparatus.
On the other hand, a concept of using a digital filter as the noise filter to the on-off input signals to control the filter constant by a microprocessor is publicly known.
For example, in xe2x80x9cprogrammable controllerxe2x80x9d disclosed in JP-A-5-119811, there is provided a filter constant change instruction capable of changing a sampling cycle while adopting an input logical value to store the value in input image memory when the input logical values of an external input signal sampled are the same value continuously by plural times.
Though this method is characterized in that the filter constant can freely be changed, in the case of handling multiple input signals, there is a problem in that a load of the microprocessor increases and control response, which is the primary purpose of the microprocessor, decreases.
In addition, as the digital filter to the on-off input signals, as shown in xe2x80x9cdata storage control apparatusxe2x80x9d disclosed in JP-A-2000-89974, there is also means constructed so as to provide a shift register as hardware and perform sampling processing in a manner similar to the concept.
Also, in xe2x80x9cswitched capacitor filterxe2x80x9d disclosed in JP-A-9-83301, a digital filter using a switched capacitor filter is indicated as a noise filter to analog input signals of multichannel.
Also in this case, there is a problem in that a load of the microprocessor increases and control response, which is the primary purpose of the microprocessor, further becomes less in the case of handling multiple analog input signals.
In addition, means constructed so as to switch resistance of an analog filter by resistor/capacitor in a multistage manner and change a filter constant is indicated in xe2x80x9cmicrocomputerxe2x80x9d disclosed in JP-A-8-305681, or a digital filter of a moving average method for handling an arithmetic average value of plural time series sampling data as data of current time after converting an analog value into a digital value is indicated in xe2x80x9cdigital filter methodxe2x80x9d disclosed in JP-A-2000-68833.
Moreover, there are the following public examples in relation to writing of programs or transfer processing associated with the invention.
Means for providing a main CPU and a sub CPU, and transferring program data of the sub CPU from ROM of the main CPU to RAM of the sub CPU and eliminating ROM of the sub CPU is proposed in xe2x80x9cprogram transfer apparatusxe2x80x9d disclosed in JP-A-7-334476.
Also, a transfer writing control method of a microprocessor for vehicle-mounted control apparatus for providing ROM capable of writing and erasing of program data by transfer of program data to be switched from the outside is proposed in xe2x80x9cvehicle-mounted control apparatusxe2x80x9d disclosed in JP-A-63-223901.
The related arts described above are partial miniaturization and standardization arts, and the fact that full-dress miniaturization and standardization into which these arts are integrated are not performed has been already described.
Particularly, there was a problem in that a decrease in control ability and response, which is the primary purpose of a microprocessor, cannot be avoided in order to achieve the miniaturization and standardization of input/output circuit parts of the microprocessor.
A first object of the invention is to achieve miniaturization and standardization of the whole control apparatus by miniaturizing input filter parts while reducing a load of a microprocessor associated with input/output processing to enhance the primary control ability and response by improving problems described above.
A second object of the invention is to standardize hardware more effectively and easily by changing control programs or control constants in correspondence with various vehicles with different control specifications.
A vehicle-mounted electronic control apparatus according to the invention comprises:
a main CPU including a first nonvolatile memory in which at least control programs and control constants, in correspondence with types of controlled vehicles, transmitted from an external tool are written, the main CPU including a first RAM for calculation processing;
a sub CPU including a second nonvolatile memory in which programs for input/output processing are written and a second RAM for calculation processing; and
a serial-parallel converter for serial communication adapted to transmit a plurality of input signals, which are input to the sub CPU, to the main CPU,
wherein a plurality of filter constants corresponding to the plurality of input signals are stored in at least one of the first and second nonvolatile memory; and
the sub CPU has a digital filter section adapted to perform predetermined calculation based on the filter constants to transmit a result of the calculation to the main CPU.
Also, the serial-parallel converter for serial communication transmits a plurality of control output signals calculated by the main CPU to the sub CPU and the serial-parallel converter supplies the plurality of control output signals to an external load through an output interface circuit connected to a data bus of the sub CPU.
Also, the plurality of input signals input to the sub CPU are a plurality of analog signals input through a noise filter including at least positive and negative clip diodes and a capacitor with a small capacity. The plurality of analog signals are conducted digital conversion into a plurality of digital converted values through an A/D converter and a digital filter including a switched capacitor periodically charged and discharged by a change-over switch and a setting unit of a charge and discharge cycle. The digital filter section performs predetermined calculation using the digital converted values to transmit a result of the calculation to the main CPU.
Also, the plurality of input signals input to the sub CPU are a plurality of on-off signals input through a bleeder resistor with a low resistance acting as a load to an input switch, a noise filter including a series resistor with a high resistance and a capacitor with a small capacity, and a comparator for level determination having a hysteresis function. The digital filter section has an input confirmation section adapted to sample outputs from the comparator for level determination in a predetermined cycle to make an ON determination when positive results of the continuous plurality of sampling results are 50% or more and to make an OFF determination if the positive results of the continuous plurality of sampling results are less than 50%. Outputs of the input confirmation section are transmitted to the main CPU.
Also, the digital filter section comprises a setting section adapted to set at least one of a sampling cycle and the number of logical determination points of the comparator for level determination.
Also, a determination value to make the input confirmation section output an ON is variable in a range of proportion of the positive results in the plurality of sampling results from 50% to 100%.
Also, there are provided a retransmission determination section. The filter constants are constants, which are corresponding to types of controlled vehicles, written in the first nonvolatile memory of the main CPU. The filter constants are transferred to the second RAM of the sub CPU through the serial-parallel converter for serial communication. A sum check of setting constants including the filter constants used in the digital filter section of the sub CPU is performed in the sub CPU. When a check sum error occurs, the retransmission determination section again transfers the filter constants from the main CPU to the sub CPU.
Also, there are provided a transfer section adapted to transfer the filter constants to the first RAM;
a control constant correction section adapted to correct control constants including the filter constants stored in the first RAM; and
a control constant transfer section adapted to transfer the corrected control constants to the second RAM of the sub CPU through the serial-parallel converter for serial communication. The filter constants are constants, which are corresponding to the types of controlled vehicles, written in the first nonvolatile memory of the main CPU. The control constants are used as setting constants of the digital filter section of the sub CPU.
Also, an input/output interface circuit for high-speed processing capable of inputting/outputting to the main CPU directly without intervention of the sub CPU is connected to a data bus of the main CPU. A signal input to the sub CPU through the input/output interface circuit is monitored by the sub CPU to transmit a monitor result to the main CPU.
Also, there are provided a removable connector adapted to connect an external tool;
a serial communication interface adapted to connect the external tool to the main CPU; and
a writing mode determination section adapted to respond to operations of a part of the plurality of input signals supplied to the sub CPU and to generate a writing control signal from the sub CPU based on programs stored in the second nonvolatile memory. The writing control signal is supplied to a writing control terminal of the main CPU to transfer and write the control programs and the control constants from the external tool to the first nonvolatile memory.